<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>员工信息</title>
</head>
<script type="text/javascript">
    eval("${remsg}");
  </script>
  <script type="text/javascript">
    eval("${errmsg}");
  </script>
  <script type="text/javascript">
    eval("${msg}");
  </script>
<body>
	<c:if test="${empty ntList}">
		<c:redirect url="http://localhost:8080/hrm/NoticeList" />
	</c:if>
	
	<c:set var="pagesize"
		value="${empty param.pagesize?15:param.pagesize }" />
	<c:set var="showpage" value="${empty param.page?1:param.page }" />

	<h3 align="center">用户信息</h3>
	
	<jsp:useBean id="pg" class="com.hongdezhi.domain.PageShowBean" scope="page" />
	<jsp:setProperty property="showpage" value="${showpage }" name="pg" />
	<jsp:setProperty property="pagesize" value="${pagesize }" name="pg" />
	${msg }
	<h4 align="center">
		管理员：${user.nameid }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="ntAdd.jsp">添加用户</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="ntQuery.jsp">查找用户</a>&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="logout">退出</a>
	</h4>
	<table border="1" width="600" align="center" cellpadding="0"
		cellspacing="0">
		<tr>
			<th>公告</th>
			<th>标题</th>
			<th>内容</th>
			<th>发布时间</th>
			<th>发布用户</th>
			<th colspan="2">操作</th>
		</tr>
		<c:forEach var="user" items="${ntList }">
			<tr>
				<td>${user.id}</td>
				<td>${user.title}</td>
				<td>${user.content}</td>
				<td>${user.createdate}</td>
				<td>${user.userid}</td>
				<td><a href="ntModify?id=${user.id}">修改|</a><a href="ntDelete?id=${user.id}">删除</a></td>
			</tr>

		</c:forEach>

	</table>
	<center>
		第${pg.showpage }页（共${pg.countpage}页） 页大小：${pg.pagesize } 总人数：${pg. countrecord }
		<br> <a href="?page=1&pagesize=${pagesize }">首页</a> <a
			href="?page=${pg.showpage-1}&pagesize=${pagesize }">上一页</a>
		<c:forEach var="i" begin="1" end="${pg.countpage }">
			<a href="?page=${ i}&pagesize=${pagesize }">${i}</a>
		</c:forEach>
		<a href="?page=${pg.showpage+1 }&pagesize=${pagesize }">下一页</a> <a
			href="?page=${pg.countpage }&pagesize=${pagesize }">末页</a>
		
		<!-- 通过表单提交用户想要显示的页数 -->
		<form action="" method="get" name="f1">
			每页大小：<select name="pagesize" onchange="aa()">
				<option value="${pagesize }">${pagesize }</option>
				<option value="15">15</option>
				<option value="20">20</option>
				<option value="25">25</option>
				<option value="30">30</option>
				<option value="35">35</option>
				<option value="40">40</option>
			</select>
		</form>

		<script type="text/javascript">
			function aa() {

				f1.submit();
			}
		</script>

		<form action="" method="get">
			<input type="hidden" name="pagesize" size="4" value="${pagesize }">
			跳转到第<input type="text" name="page" size="4" value="1">页 
			<input type="submit" value="跳转">
		</form>
		<%-- <jsp:include page="0305.jsp"></jsp:include> --%>
	</center>
	<h3 align="center">软件A1803 0411180305 洪得智</h3>
</body>
</html>